<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>&lt;webview&gt; Devtools Demo</title>
    <style>
      html,
      body {
        margin: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-flow: row;
        overflow: hidden;
      }
      #webview {
        flex: 2;
      }
      #devTools {
        flex: 1;
        border-left: 1px solid #ccc;
      }
    </style>
  </head>
  <body>
    <webview id="webview" src="https://www.bilibili.com"></webview>
    <webview id="devTools" src="about:blank"></webview>
    <script>
      const webview = document.querySelector("#webview");
      const devTools = document.querySelector("#devTools");
      devTools.addEventListener("contentload", () => {
        webview.showDevTools(true, devTools);
      });
    </script>
  </body>
</html>
